import request from '@/utils/request'
/**
 * 获取线索列表
 * @returns
 */
export const getClueListApi = (params) => {
  return request({
    url: '/clues/clue/list',
    params
  })
}
/**
 * 获取回显信息
 * @param {*} params
 * @returns
 */
export const getClueDataApi = (id) => {
  return request({
    url: `/clues/clue/${id}`
  })
}
/**
 * 获取伪线索原因下拉列表
 * @returns
 */
export const getRosListApi = () => {
  return request({
    url: `/dict/data/type`
  })
}
/**
 * 添加线索
 * @param {*} data
 * @returns
 */
export const addClueApi = (data) => {
  return request({
    url: `/clues/clue`,
    method: 'POST',
    data
  })
}
/**
 * 树状列表
 * @returns
 */
export const getTreeListApi = () => {
  return request({
    url: `/api/system/dept/treeselect`
  })
}
/**
 * 为线索下拉列表部门对应人数
 * @returns
 */
export const getUserListApi = (deptId) => {
  return request({
    url: `/api/system/user/listselect`,
    params: {
      deptId
    }
  })
}
/**
 * 线索分配
 * @param {*} data
 * @returns
 */
export const alloClueApi = (arr) => {
  return request({
    url: `/clues/clue/assignment`,
    method: 'PUT',
    data: arr
  })
}
/**
 * 伪线索
 * @param {*} id
 * @returns
 */
export const goWeiClueApi = (id, data) => {
  return request({
    url: `/clues/clue/false/${id}`,
    method: 'PUT',
    data
  })
}
/**
 * 线索池分页查询
 * @returns
 */
export const getCluePoolListApi = (params) => {
  return request({
    url: `clues/clue/pool`,
    params
  })
}
/**
 * 批量捞取
 * @param {*} data
 * @returns
 */
export const goBackListApi = (data) => {
  return request({
    url: `clues/clue/gain`,
    method: 'PUT',
    data
  })
}
/**
 * 线索侧面渲染
 * @param {*} data
 * @returns
 */
export const addOptionListApi = (data) => {
  return request({
    url: `/clues/clue/follow`,
    method: 'PUT',
    data
  })
}
/**
 * 线索列表
 * @param {*} params
 * @returns
 */
export const getclueListApi = (params) => {
  return request({
    url: '/report/cluesStatisticsList',
    params
  })
}
/**
 * 转商机
 * @param {*} id
 * @returns
 */
export const getComListApi = (id) => {
  return request({
    url: `/clues/clue/changeBusiness/${id}`,
    method: 'PUT'
  })
}

/**
 * 线索转化率
 * @param {*} beginCreateTime
 * @param {*} endCreateTime
 * @returns
 */
export const getclueEchartsApi = (beginCreateTime, endCreateTime) => {
  return request({
    url: `/report/getVulnerabilityMap/${beginCreateTime}/${endCreateTime}`
  })
}
/**
 * 新增线索统计
 * @param {*} data
 * @returns
 */
export const getclueEchartApi = (beginCreateTime, endCreateTime) => {
  return request({
    url: `/report/cluesStatistics/${beginCreateTime}/${endCreateTime}`
  })
}
